home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: miker3@ix.netcom.com (Mike Rubenstein)
- Newsgroups: comp.lang.c,comp.unix.programmer
- Subject: Re: fgetc and getc (was Q: '\n' character)
- Date: Fri, 19 Apr 1996 13:38:44 GMT
- Organization: Netcom
- Message-ID: <3177965a.140894856@nntp.ix.netcom.com>
- References: <4kj66f$k0o@ren.cei.net> <4ku8f9$d3o@mark.ucdavis.edu> <4kumbqINNgcr@mayne.ugrad.cs.ubc.ca> <4l13uu$mva@mark.ucdavis.edu> <4l1ap4INNhsc@keats.ugrad.cs.ubc.ca> <Dq1s7F.Bo1@ukpsshp1.serigate.philips.nl>
- NNTP-Posting-Host: ix-dc14-19.ix.netcom.com
- X-NETCOM-Date: Fri Apr 19 6:38:50 AM PDT 1996
- X-Newsreader: Forte Agent .99d/32.182
-
- baynes@ukpsshp1.serigate.philips.nl (Stephen Baynes) wrote:
-
- > Note however ANSI C does relax the rules slightly for getc and putc, if they
- > are implemented as a macro they can evaluate their argument more than once,
- > which fgetc and fputc cannot.
-
- A minor correction. They may evaluate their FILE* argument more than
- once. putc must evaluate its int argument exactly once.
-
- FILE** f;
- int c;
- ...
- putc(c++, *f); /* safe */
- putc(c, *f++); /* not safe */
-
- Michael M Rubenstein
-